export let title = {
  show: false,
  text: "标题",
  top: 0,
  left: 0,
  textStyle: {
    fontSize: "10",
    color: "#000",
    fontWeight: "normal",
    fontFamily: "sans-serif",
  },
};

export let tooltip = {
  trigger: "axis",
  axisPointer: {
    type: "shadow",
  },
};

export let legend = {
  show: true,
  right: "0%",
  top: "0%",
  textStyle: {
    color: "#fff",
    fontSize: 10,
  },
};

export let grid = {
  top: "5%",
  left: "2%",
  right: "2%",
  bottom: "3%",
  containLabel: true,
};

export let xAxis = {
  axisTick: {
    alignWithLabel: true,
  },
  axisLabel: {
    color: "#FFF",
  },
  axisLine: {
    color: "#fff",
  },
  axisLine: {
    lineStyle: {
      color: "#fff",
    },
  },
};

export let yAxis = {
  type: "value",
  axisLabel: {
    color: "#CCC",
  },
  axisLine: {
    show: true,
    lineStyle: {
      color: "#fff",
    },
  },
};

export let bar = {
  name: "OK",
  type: "bar",
  stack: "总量",
  barWidth: "30%",
  label: {
    show: true, //开启显示
    position: "inside", //在上方显示
    color: "#fff",
  },
  itemStyle: {
    color: "#0f0",
  },
};

export let line = {
  type: "line",
  stack: "Total",
  smooth: false,
  emphasis: {
    focus: "series",
  },
  lineStyle: {
    width: 4,
    color: "#FF9900",
    type: "solid",
  },
  label: {
    show: false,
    position: "top",
    color: "#000",
    fontSize: 12,
  },
};

export let pie = {
  type: "pie",
  radius: ["15%", "50%"],
  center: ["50%", "50%"],
  avoidLabelOverlap: false,
  // width: "100%",
  roseType: false,
  label: {
    alignTo: "edge",
    lineHeight: 18,
    edgeDistance: 1,
  },
  labelLine: {
    show: true,
    length: 20,
    length2: 80,
    lineStyle: {
      color: "#d3d3d3",
    },
    color: "#f00",
  },
  label: {
    show: true,
    position: "inside",
  },
  itemStyle: {
    borderRadius: 0,
  },
};

export let barOption = {
  title,
  tooltip,
  grid,
  xAxis,
  yAxis,
  series: bar,
};

export let lineOption = {
  title,
  tooltip,
  legend,
  grid,
  xAxis,
  yAxis,
  series: line,
};

export let pieOption = {
  title,
  tooltip,
  legend,
  series: pie,
};
